﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DataModel;
using DataAccess.Datatypes;
using BussinesLayer.Services;

namespace Mvc4.Areas.Admin.Controllers
{
    public class UserController : AdmController
    {
        private ModelContainer db = new ModelContainer();
        private UserServices us = new UserServices();

        //
        // GET: /Admin/User/

        public ActionResult Index()
        {
            ViewBag.SiteName = "Manage Users";
            IEnumerable<User> users = us.GetInfractors();
            return View(users);
        }

        public ActionResult BlockUser(int userId)
        {
            us.BlockUser(userId);
            return RedirectToAction("Index");
        }

    }
}